<pre>
    <?php
    ini_set("soap.wsdl_cache_enabled", "0");
    define('WSDL_PATH', 'http://localhost/WS/services.wsdl');

    try
    {
        echo PHP_EOL;
        $client = new SoapClient(WSDL_PATH, array('trace' => 1));

        echo "Register a new user and getting its ID" . PHP_EOL;
        $id = $client->__call('doRegister', array('myuser' . date('d-i-s'), 'mypwd'));
        echo '  * ID:' . $id . PHP_EOL;

        echo "Add a trip with existing towns" . PHP_EOL;
        $client->__call('doAddTrip', array('Orleans', 'Paris', $id, '10-21-2009', '', 3));

        echo "Add a trip with new towns" . PHP_EOL;
        $client->__call('doAddTrip', array('Petite-ville', 'Grande ville', $id, '10-21-2009', '', 1));

        echo "Add a trip with maximum parameters" . PHP_EOL;
        $tripId = $client->__call('doAddTrip', array(
                                            'Petite-ville',
                                            'Grande ville',
                                            $id,
                                            '',
                                            '20:10',
                                            1,      // driver
                                            true,   // mo
                                            false,  // tu
                                            true,   // we
                                            false,  // th
                                            true,   // fr
                                            false,  // sa
                                            true,   // su
                                           ));

        echo "Retrieve this complex trip" . PHP_EOL;
        var_dump($client->__call('doGetTripInfo', array($tripId)));

        echo "Update user info" . PHP_EOL;
        $client->__call('doUpdateUserInfo', array($id, 'Willy', 'Sagnol', '01234567', '4 rue du coucou, 42042 QUARANTEDEUX'));

        echo "Add new contacts" . PHP_EOL;
        $client->__call('doAddContact', array($id, 2));
        $client->__call('doAddContact', array($id, 3));
        $client->__call('doAddContact', array($id, 4));

        echo "Retrieve the list of contacts :" . PHP_EOL;
        $list = $client->__call('doGetListOfContacts', array($id));
        foreach ($list as $key => $contact) {
            echo '   * ' . $contact->login . PHP_EOL;
        }

        echo "Retrieve user profile, by ID" . PHP_EOL;
        $profile = $client->__call('doGetUserInfo', array($id));
        echo '  * login of id #' . $id .': ' . $profile->login . PHP_EOL;

        echo "Retrieve user profile, by login (here: Alexis)" . PHP_EOL;
        $profile = $client->__call('doGetUserByLogin', array('alexis'));
        echo '  * id of user "' . $profile->login .'": ' . $profile->id . PHP_EOL;

        echo "Retrieve the list of trips for this user" . PHP_EOL;
        $trips = $client->__call('doGetListOfTrips', array($id));
        foreach ($trips as $key => $trip) {
            echo "  * from ".urldecode($trip->from)." to ".urldecode($trip->to) . PHP_EOL;
            var_dump($trip);
        }

        echo "Try to login as adrien" . PHP_EOL;
        $adrien_id = $client->__call('doLogin', array('adrien', 'adrien'));
        echo '  * user_id: ' . $adrien_id . PHP_EOL;
    }
    catch (SoapFault $fault) {
        echo $fault;
    }
    ?>
</pre>